package com.jzr.netty;


import com.jzr.netty.service.NettyServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;


@EnableEurekaClient
@SpringBootApplication(exclude={
		DataSourceAutoConfiguration.class,
		DataSourceTransactionManagerAutoConfiguration.class,
})
public class NettyServiceApplication implements CommandLineRunner {
	@Autowired
	NettyServer nettyServer;

	public static void main(String[] args) {
		SpringApplication.run(NettyServiceApplication.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
		try {
			Thread t = new Thread(nettyServer);
			t.start();
		}catch (Exception ex){
			ex.printStackTrace();
		}
	}

}
